<?php
class Tester extends CI_Controller{
	public function index(){
		$this->load->helper('html_helper');
		$em = $this->doctrine->em;
		//$modelRepo = $em->getRepository('entities\IM_Model');
		$data['mods'] = $em->getRepository('entities\IM_Model')->getAll();
		$data['header'] = array(
			'title'=> 'tester',
			'scripts' => array(
				'js'=> array(
						base_url() . 'fe/js/lib/jquery/jquery-1.7.js',
						base_url() . 'fe/js/lib/jquery/jquery-ui-1.8.19.custom.min.js',
						base_url() . 'fe/js/tester.js'
				),
				'css'=> array(
					array(
						'url'=> base_url() . 'fe/design/vader/jquery-ui-1.8.16.custom.css',
						'media'=> 'screen'
					)		
				)
			)
		);
		$this->load->view('templates/header', $data);
		$this->load->view('pages/home', $data);
		$this->load->view('templates/footer', $data);
	}
	
	public function testAjax(){

		if($this->input->is_ajax_request()){
			$this->output
				->set_content_type('application/json')
				->set_output(json_encode($_GET));
		}else{
			$this->output->set_content_type('application/json');
			die(json_encode(array('failure')));
		}
	}
	
}